import React, { Component } from "react";
import "antd/dist/antd.css";
import { Descriptions, Card } from "antd";
import { AppleOutlined } from "@ant-design/icons";

class StepDetail1 extends Component {
  constructor(props) {
    super(props);
    this.info = props.info;
  }

  render() {
    if (this.info.inquiry_id)
      return (
        <div style={{ marginTop: "16px" }}>
          <Card>
            <Descriptions
              title={`询价单${this.info.inquiry_id}`}
              bordered
              column={2}
            >
              <Descriptions.Item label="公司">{`${this.info.company_name}(${this.info.company_id})`}</Descriptions.Item>
              <Descriptions.Item label="创建时间">
                {this.info.inquiry_date}
              </Descriptions.Item>
              <Descriptions.Item
                label="操作员"
                span={2}
              >{`${this.info.inq_opname}(${this.info.inq_opid})`}</Descriptions.Item>
              <Descriptions.Item label="询价详情" span={3}>
                {this.info.invoicedtl.map((product) => (
                  <div>
                    <AppleOutlined />
                    <h>{product.goods_name}</h>
                  </div>
                ))}
              </Descriptions.Item>
            </Descriptions>
          </Card>
        </div>
      );
    else
      return (
        <div>
          <Card>
            <Descriptions title="无参考询价单" />
          </Card>
        </div>
      );
  }
}

export default StepDetail1;
